<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>增加用户</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" href="../../../component/elementUI/index.css" />
    <link rel="stylesheet" href="../../../style/index.css" />
    <link rel="stylesheet" href="../../../component/pear/css/pear.css" />
    <style>
      .upload_file.none .el-upload {
        display: none;
      }
    </style>
  </head>

  <body>
    <div id="app" class="minWidth">
      <el-form
        :model="form"
        :rules="rules"
        ref="contract"
        inline-message="true"
        style="width: 100%"
      >
        <div class="table_titel">
          <div class="titel">增加轮播图</div>
          <div class="operation">
            <el-button type="primary" size="small" @click="add_form"
              >新增</el-button
            >
            <!-- <el-button type="danger" size="small" @click="remove_form"
              >删除</el-button
            > -->
          </div>
        </div>
        <div style="margin-bottom: 100px">
          <el-descriptions
            :column="2"
            border
            size="small"
            v-for="(item, index) in form.filter(item => item.Row_Status != '1')"
            :key="index"
          >
            <el-descriptions-item label="轮播图片">
              <!-- 使用 flex 布局并设置两端对齐 -->
              <div
                style="
                  display: flex;
                  align-items: center;
                  justify-content: space-between;
                "
              >
                <el-form-item prop="Picture_URL">
                  <el-upload
                    :id="index"
                    :limit="1"
                    multiple
                    :file-list="showFileList(index)"
                    :class="['upload_file', {'none': showFileList(index)?.length }]"
                    list-type="picture-card"
                    :before-upload="(file) => dhandleBeforeUpload(file,index)"
                    :on-remove="(file) =>dhandleRemove(file,index)"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
                <!-- 删除按钮 -->
                <el-button
                  type="danger"
                  size="small"
                  :id="index"
                  @click="remove_form(index)"
                >
                  删除
                </el-button>
              </div>
            </el-descriptions-item>
          </el-descriptions>
        </div>
        <el-form-item class="form-operation">
          <el-button @click="window.history.back()">返回</el-button>
          <el-button
            type="primary"
            :loading="loading"
            @click="submitForm('contract')"
            >提交</el-button
          >
        </el-form-item>
      </el-form>
    </div>
    <script
      type="text/javascript"
      src="../../../utils/jquery-3.6.0.min.js"
    ></script>
    <script
      type="text/javascript"
      src="../../../utils/jquery.cookie.js"
    ></script>
    <script type="text/javascript" src="../../../utils/vue.min.js"></script>
    <script
      type="text/javascript"
      src="../../../component/elementUI/index.js"
    ></script>
    <script type="text/javascript" src="../../../utils/utils.js"></script>
    <script type="text/javascript" src="../../../utils/compressor.js"></script>
    <script type="text/javascript" src="../../../utils/ID_Validity.js"></script>
    <script type="text/javascript" src="./js/Add.js"></script>
  </body>
</html>
